@extends('admin.layouts.base')
@section('title','产品录入表')
@section('pageHeader','产品录入')

@section('content')
    <div class="row">
        <div class="col-lg-12">
            {{--提示信息弹出框--}}
            @include('admin.partials.errors')
            @include('admin.partials.success')
            {{--提示信息弹出框--}}

            <div class="box box-success">
                {{--内容主体 开始--}}
                <div class="box-header">
                    <h1 class="box-title">{{ $pname }}产品名称 - 录入</h1>
                </div>
                <form action="{{ url('admin/productdata/insert') }}" method="post">
                <div class="box-body">
                    <table id="data-table" class="table table-striped">
                        @foreach($data as $index=>$item)
                        <thead>
                        <input type="hidden" name="_token" value="{{ csrf_token() }}" />
                        <input type="hidden" name="product_id" value="{{ $id }}" />
                        <tr>
                            <td>录入目标数据日期</td>
                            <td>{{ $nowdate }}</td>
                            <td><input type="hidden" name="date_time" value="{{ $nowdate }}" /></td>
                        </tr>
                        <tr>
                            <td>最后修改时间</td>
                                @if($item->update_time)
                                    <td>{{ $item->update_time }}</td>
                                    <td><input type="hidden" name="update_time" value="{{ $item->update_time }}"/></td>
                                    @else
                                    无
                                @endif
                        </tr>
                        <tr>
                            <td>最后修改人</td>
                            @if($item->update_admin)
                                <td>{{ $item->update_admin }}</td>
                                <td><input type="hidden" name="update_admin" value="{{ $item->update_admin }}"/></td>
                                @else
                                <td>无</td>
                                <td><input type="hidden" name="update_admin" value="{{ $nowname }}"/></td>
                                @endif
                        </tr>
                        <tr>
                            <td>注册人数</td>
                            <td><input type="number"  name="reg_number" min="1" max="100000000" required  /></td>
                        </tr>
                        <tr>
                            <td>申请 / 进件</td>
                            <td><input type="number" name="apply_number" min="1" max="100000000" required/></td>
                        </tr>
                        <tr>
                            <td>放贷人数</td>
                            <td><input type="number" name="loan_number" min="1" max="10000000" required/></td>
                        </tr>
                        <tr>
                            <td>放贷金额</td>
                            <td><input type="text" name="loan_sum_m" required style="width: 140px"/></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td><input type="submit" class="btn btn-success"/></td>
                        </tr>

                        </thead>
                        @endforeach
                    </table>
                </div>
                </form>
                {{--内容主体 结束--}}

            </div>
        </div>
    </div>
@endsection

@section('js')
    <script>
        setInterval(function () {
            $("#jg").fadeOut(1000);
        }, 3000);
        // 设置统一ajax请求参数:csrf_token
        /*$.ajaxSetup({
         headers: {
         'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
         }
         });*/

    </script>
@endsection
